package com.yuebook.base.common.dto;

import lombok.Data;

/**
 * @author honglei
 * @date 2018/10/26 下午9:18
 */
@Data
public class ResponseDTO {

    private String code;

    private String errMsg;

    private Object body;

    public static ResponseDTO success(Object obj) {
        ResponseDTO dto = new ResponseDTO();
        dto.code = "200";
        dto.body = obj;
        return dto;
    }

    public static ResponseDTO fail(String errMsg) {
        ResponseDTO dto = new ResponseDTO();
        dto.code = "500";
        dto.errMsg = errMsg;
        return dto;
    }

}
